package ice.db;

import ice.Environment;
import ice.utils.ResourceUtil;

import org.apache.commons.dbcp.BasicDataSource;

/**
 * LocalDataSource
 * 
 * @author abiao
 */
public class LocalDataSource extends BasicDataSource {

    public LocalDataSource(String driver, String url, String user, String pass) throws ClassNotFoundException {
        ResourceUtil.forName(driver);
        setUrl(url);
        setUsername(user);
        setPassword(pass);
        setDefaultReadOnly(false);
        connectionPool.setWhenExhaustedAction(Environment.getByte(Environment.DBCP_WHEN_EXHAUSTED_ACTION));
    }
}
